<html>
<head><meta charset="utf-8"><title>debugging lints · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/debugging.20lints.html">debugging lints</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219939395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/debugging%20lints/near/219939395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/debugging.20lints.html#219939395">(Dec 15 2020 at 05:26)</a>:</h4>
<p>Hi! Since, it appears, 0.2.400 or 0.2.408, I am getting a macro-error lint on any asm blocks (repro: <code>unsafe { asm!("") }</code>) which I'd like to fix myself to learn how the project works. I've read the dev docs which say that the usual way of managing this kind of thing is to write a unit test, however, I couldn't quite figure out where to put that test.</p>
<p>The page I read (<a href="https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev">https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev</a>) said that such things might go in the parser crate, but I don't know what it means by "manual test" and whether that is what I want. It also seems to be that the error for this is generated by something to do with HIR, which makes it unclear to me whether it would be triggered by tests in there.</p>
<p>Can someone give me some pointers on where to start on this?</p>



<a name="219944673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/debugging%20lints/near/219944673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/debugging.20lints.html#219944673">(Dec 15 2020 at 07:31)</a>:</h4>
<p>Seem like we are not supported asm builtin macro yet, you could follow how PR <a href="https://github.com/rust-analyzer/rust-analyzer/pull/6874">#6874</a> works and add a test similar to <a href="https://github.com/jonas-schievink/rust-analyzer/blob/81820fe52cde8e2433eb140441375e408e2659ee/crates/hir_expand/src/builtin_macro.rs#L210">this</a></p>



<a name="219944818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/debugging%20lints/near/219944818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/debugging.20lints.html#219944818">(Dec 15 2020 at 07:33)</a>:</h4>
<p>And I think a dummy implementation for <code>asm</code> macro is okay for now</p>



<a name="219951905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/debugging%20lints/near/219951905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/debugging.20lints.html#219951905">(Dec 15 2020 at 09:12)</a>:</h4>
<p>alrighty, thanks for the help! I've filed a PR: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/6889">https://github.com/rust-analyzer/rust-analyzer/pull/6889</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>